20
21st
22
23
24
3 ISO Week of 1999
25
26
27
28
29
30
31
4 ISO Week of 1999
acquired year in Oracle
1. Oralce Standard-YYYY
The way the Oralce standard gets the year is simple:
Select To_char (to_date (' 1997/01/01 ', ' yyyy/mm/dd '), ' YYYY ') from dual;
Select To_char (to_date (' 1997/12/31 ', ' yyyy/mm/dd '), ' YYYY ') from dual;
Are all back to 1997.
2. ISO standard-IYYY
Processing of time in Oracle Database:
4824 hours for HH24
Select to_char (sysdate, 'yyyy-MM-dd HH24: mi: ss') from dual;
Select to_date ('1970-01-01 13:14:20 ', 'yyyy-MM-dd HH24: mi: ss') from dual;
To_date () function
1. Description of date format parameters
D. day of the week
The name of DAY, which is filled with spaces to 9 characters.
Day of DD month
The day of the year in DDD
Short Name of DY day
Week of the Year of the iw iso Standard
Four-digit year of the
Note: organize to Network
24HoursHh24
Select to_char (sysdate, 'yyyy-mm-dd hh24: MI: ss') from dual;
Select to_date ('1970-01-01 13:14:20 ', 'yyyy-mm-dd hh24: MI: ss') from dual;
To_date () function
1.Date Format ParametersDescription
DDay of the week
DayThe name of the day, filled with spaces9Characters
DdThe day of the month
DddDay of the year
DyAbbreviated name of day
IW ISOWeek of the standard year
Iyyy ISOStandard four-digit year
YyyyFo
Label:httpjava Use osio Data forart
Oracle character numeric date conversion java code 24 hours is shown in the form of HH24 select to_char (sysdate, ' yyyy-mm-dd HH24:mi:ss ') from dual; select to_date (' 2005-01-01 13:14:20 ', ' yyyy-mm-dd HH24:mi:ss ') from dual; to_date () function 1. Date format parameter meaning description d days of the week day the name of the day, using spaces to fill 9 characters dd month of the first day of the ddd year of the day NBSP;N Bsp;dy Day abbreviat
dual; In general SQL: select to_date ('2017-06-28 19:51:20 ', 'yyyy-MM-dd HH: mm: ss') from dual;
Differences:View Code
1. Change HH to HH24. 2. Change mm in minutes to mi. The 24-hour format is displayed with HH24select to_char (sysdate, 'yyyy-MM-dd HH24: mi: ss') from dual; select to_date ('2017-01-01 13:14:20 ', 'yyyy-MM-dd HH24: mi: ss') from dual; to_date () function1. description of the parameter meaning of the date format D name of the DAY of the week, fill in a space to nine characters
]
Is the millisecond, if not the number is the default precision.
Can only be used with timestamp types.
16
Fm
One of the notable functions: no content is returned.
I'm not sure why Oracle set this thing up.
17
Fx
Ditto
18
HH
Represents hours, 12-hour, with Hh12 (1-12)
19
HH12
Represents hours, 12-hour (1-12)
20
HH2
') wocould return '192. 7'To_char (1210.73, '20140901') wocould return '20160301'To_char (1210.73, '$9,999.00') wocould return '$1,210.73'To_char (21, '20140901') wocould return '20160901'
Date instance
The following is a valid parameter list. The to_char function is used to convert a string to a date. These parameters can be used in multiple combinations.
Parameter
Explanation
YEAR
Year, spelled out
YYYY
4-digit year
YYYYYY
Oracle SQL uses mi instead of minutes.
Select to_date ('1970-01-01 13:14:20 ', 'yyyy-MM-dd HH24: mi: ss') from dual; 2. Another 24-hour format is used to display HH24.Select to_char (sysdate, 'yyyy-MM-dd HH24: mi: ss') from dual; // mi is minuteSelect to_char (sysdate, 'yyyy-MM-dd HH24: mm: ss') from dual; // mm displays the meaning of the to_date parameter in the month oracle.
1. Description of date format parametersD. day of the weekThe name of DAY, which is filled with spaces to 9 characters
Date conversion in Oracle and Java date conversion in java date conversion to date summary in oracle: 1. Date attribute in Entity class is defined as String type. 2. Write the column corresponding to the date in the SQL statement as to_date (?, 'Yyyy-mm-dd hh24: mi: ss') 3. assign a value to the date attribute of the java entity class: SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-dd HH: mm: ss ");... www.2cto.com product. setPdate (sdf. format (new Date (); reads data of the date type f
The following articles mainly focus on the processing of common time in Oracle databases. The processing of common time in Oracle databases is often used in practical applications. The following articles are the solutions to actual problems, the following is a description of the specific solution. I hope it will help you in your future study.
4824 hours for HH24
selectto_char(sysdate,'yyyy-MM-ddHH24:mi:ss')fromdual;
selectto_date('2005-01-0113:14:20','yyyy-MM-ddHH24:mi:ss')fromdual;
The following articles mainly describe the actual operation steps of time processing in the Oracle database. We will describe the instance in the form of 4824 hours, and we will use HH24 to display it, the following is an analysis of the specific content of the article. I hope you will gain some benefits.
selectto_char(sysdate,'yyyy-MM-ddHH24:mi:ss')fromdual;
selectto_date('2005-01-0113:14:20','yyyy-MM-ddHH24:mi:ss')fromdual;
to_date()function
1. Description of date format parame
In Oracle/PLSQL, the trunc function returns a date truncated to a specific unit of measure.The syntax for the trunc function is:Trunc (date, [format])Date is the date to truncate.Format is the unit of measure to apply for truncating. if the format parameter is omitted, the trunc function will truncate the date to the day value, so that any hours, minutes, or seconds will be truncated off.
Below are the valid format parameters:
Unit
Valid format parameters
Year
SYYYY, YYY
to_char (sysdate, 'yyyy-MM-dd HH24: mi: ss') from dual; // mi is minuteSelect to_char (sysdate, 'yyyy-MM-dd HH24: mm: ss') from dual; // mm displays the monthDescription of the to_date parameter in oracle1. Description of date format parametersD. day of the weekThe name of DAY, which is filled with spaces to 9 characters.Day of DD monthThe day of the year in DDDShort Name of DY dayWeek of the Year of the iw iso StandardFour-digit year of the iyyy iso
Oracle to_date usageDescription of date format parametersD. day of the weekThe name of day, which is filled with spaces to 9 characters.Day of DD monthThe day of the year in DDDShort Name of Dy dayWeek of the Year of the iw iso StandardFour-digit year of the iyyy ISO StandardYyyy four-digit yearLast three digits of YYY, YY, and Y years, two digits, one digitHH hours, at 12 hoursHh24 hours, in 24 hoursMi scoreSS secondsMm MonthAbbreviated month of MonF
measure.In oracle, The trunc function returns a date value intercepted by a specific unit of measurement.The syntax for the trunc function is:Syntax:Trunc (dat1e, [format])Da1te is the date to truncate.Da1te is the date to be truncatedFormat is the unit of measure to apply for truncating. if the format parameter is omitted, the trunc function will truncate the date to the day value, so that any hours, minutes, or seconds will be truncated off.Format is the unit of measurement (similar to the pr
Date Format Parameters
Description
D
Day of the week
DAY
The name of the day, with a space of 9 Characters
DD
The day of the month
DDD
Day of the year
DY
Abbreviated name of day
IW
Week of the Year of the ISO standard
IYYY
ISO standard four-digit year
YYYY
Four-digit year
YYY, YY, Y
The last three digits of the year, two digits, one digit
])-- Converts string to datE
To_multi_byte (STR) -- convertS single byte string to multi byte string
To_number (STR [, FMT]) -- convertS str to a number formatted by FMT
To_single_byte (STR)-- Converts multi byte StRing to single byte string
*******************************************************************************
* SQL date formats*
***************************************************************
****************
BC, B .C. BC indicatorAD, A.D. Ad indicatorCC, SCC centUry
.
Midday logo (lower case)
Y, yyy
Year with commas)
Yyyy
Year (4 and more)
Yyy
The last three digits of the year
YY
The last two
Y
The last digit of the year
Iyyy
ISO year (four or more digits)
Iyy
The last three digits of the ISO year
Iy
The last two digits of the ISO year
I
The last digit of the
name of DAY, which is filled with spaces to 9 characters.
Day of DD month
The day of the year in DDD
Short Name of DY day
Week of the Year of the iw iso Standard
Four-digit year of the iyyy iso Standard
YYYY four-digit year
Last three digits of YYY, YY, and Y years, two digits, one digit
HH hours, at 12 hours
HH24 hours, in 24 hours
MI score
SS seconds
MM Month
Abbreviated month of Mon
Full name of Month
W the week of the month
The week in WW
1. Date
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.